﻿<!DOCTYPE HTML>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>
        优质水会 / 技师详情
    </title>
    <meta name="keywords" content="" />
    <meta name="description" content="技师详情" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui">
    <meta name="generator" content="" data-variable="/,cn,10001,,10001,res032" />
    <link rel='stylesheet' href='css/index.css'>
</head>

<body class="met-navfixed">
    <header id="header" class="header-fixed">
        <div class="container">
            <ul class="head-list">
                <li class="left tel">
                    <img src="images/1514354107.png" alt="">
                    <span>
                        全国咨询热线：
                    </span>
                    <em>
                        400-123-4567
                    </em>
                </li>
                <li class="right">
                    <ul>
                        <li>
                            <img src="images/1514355047.png" alt="一流的服务">
                            <span>
                                一流的服务
                            </span>
                        </li>
                        <li>
                            <img src="images/1514354958.png" alt="透明的价格">
                            <span>
                                透明的价格
                            </span>
                        </li>
                        <li>
                            <img src="images/1514354817.png" alt="重信守誉">
                            <span>
                                重信守誉
                            </span>
                        </li>
                        <li>
                            <img src="images/1514354461.png" alt="优质的技师">
                            <span>
                                优质的技师
                            </span>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </header>
    <nav class="navbar navbar-default met-nav navbar-fixed-top" role="navigation">
        <div class="container">
            <div class="row">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle hamburger hamburger-close collapsed"
                        data-target="#navbar-default-collapse" data-toggle="collapse">
                        <span class="sr-only">
                            Toggle navigation
                        </span>
                        <span class="hamburger-bar">
                        </span>
                    </button>
                    <a href="#" ​ class="navbar-brand navbar-logo vertical-align" title="中电金信有限公司(自适应手机端)">
                        <h1 class='hide'>
                            中电金信有限公司(自适应手机端)
                        </h1>
                        <div class="vertical-align-middle">
                            <img src="images/logom.png" alt="中电金信有限公司(自适应手机端)" title="中电金信有限公司(自适应手机端)" />
                        </div>
                    </a>
                    <h2 class='hide'>
                    </h2>
                </div>
                <div class="collapse navbar-collapse navbar-collapse-toolbar" id="navbar-default-collapse">
                    <ul class="nav navbar-nav navbar-right navlist">
                        <li>
                            <a href="index.html" ​ title="网站首页" class="link">
                                网站首页
                            </a>
                        </li>
                        <li class="dropdown margin-left-20">
                            <a class="dropdown-toggle link " data-toggle="dropdown" data-hover="dropdown"
                                aria-expanded="false" href="about.html">
                                关于我们
                                <span class="caret">
                                </span>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-right bullet">
                                <li>
                                    <a href="about.html" ​ class="" title="公司简介">
                                        公司简介
                                    </a>
                                </li>
                                <li>
                                    <a href="message.html" ​ class="" title="在线留言">
                                        在线留言
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown margin-left-20">
                            <a class="dropdown-toggle link active" data-toggle="dropdown" data-hover="dropdown"
                                aria-expanded="false" href="product.html">
                                优质水会
                                <span class="caret">
                                </span>
                            </a>
                            <ul class="dropdown-menu dropdown-menu-right bullet">
                                <li>
                                    <a href="productcate1.html" ​ class="" title="丽丝">
                                        丽丝水会
                                    </a>
                                </li>
                                <li>
                                    <a href="productcate2.html" ​ class="" title="威美斯">
                                        威美斯水会
                                    </a>
                                </li>
                                <li>
                                    <a href="productcate3.html" ​ class="" title="贝帮">
                                        贝帮水会
                                    </a>
                                </li>
                                <li>
                                    <a href="productcate4.html" ​ class="" title="月荷湾">
                                        月荷湾水会
                                    </a>
                                </li>
                                <li>
                                    <a href="productcate5.html" ​ class="" title="月荷湾">
                                        其它水会
                                    </a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown margin-left-20">
                            <a class=" link " href="contact.html">
                                联系我们
                            </a>
                            <ul class="dropdown-menu dropdown-menu-right bullet">
                            </ul>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </nav>

    <!--这里是页面动态加载个人信息部分-->
    <div class="page met-showproduct pagetype1 animsition">
        <div class="met-showproduct-body">
            <div class="container">
                <div class="row no-space">
                    <div class="col-md-9 product-content-body">
                        <div class="row">
                            <div class="panel product-detail">
                                <div class="panel-body">
                                    <ul class="nav nav-tabs nav-tabs-line met-showproduct-navtabs affix-nav">
                                        <li class="active">
                                            <a data-toggle="tab" href="#product-details" data-get="product-details">
                                                详细信息
                                            </a>
                                        </li>
                                    </ul>
                                    <div class="tab-content">
                                        <div class="tab-pane met-editor lazyload clearfix animation-fade active"
                                            id="product-details">
                                            <div>
                                                <!-- 主图位置 -->
                                                <img id="techMainImg" alt="" style="width: 300px; height: 200px;" />
                                                <br />
                                                <div id="techName1" style="margin-left: 120px;"></div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--右侧开始-->
                    <div class="col-md-3">
                        <div class="row">
                            <div class="panel product-hot">
                                <div class="panel-body">
                                    <h2 class="margin-bottom-15 font-size-16 font-weight-300">
                                        扫码加微信
                                    </h2>
                                    <ul class="blocks-2 blocks-sm-3 mob-masonry" data-scale='1'>
                                        <li>
                                            <a href="productshow.html" class="img" title="姓名">
                                                <!-- 右侧二维码图片位置 -->
                                                <img id="techQrCodeImg" class="cover-image" style='height:200px;'
                                                    alt="二维码">
                                            </a>
                                            <a href="productshow.html" id="techName2" class="txt" title="姓名">
                                                姓名
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--右侧结束-->
                </div>
            </div>
        </div>
    </div>

    <footer>
        <div class="container text-center">
            <p>
                CopyRight &copy; 2020-2030 中电金信有限公司 版权所有
            </p>
            <p>
                ICP备XXXXXXXX号
            </p>
        </div>
    </footer>
    <button type="button" class="btn btn-icon btn-primary btn-squared met-scroll-top hide">
        <i class="icon wb-chevron-up" aria-hidden="true">
        </i>
    </button>
    <script src="js/index.js"></script>

    <style>
        /* 精确控制主图与姓名间距 */
        #product-details>div {
            display: flex;
            flex-direction: column;
            align-items: flex-start;
        }

        #techMainImg {
            width: 301px !important;
            height: 450px !important;
            object-fit: cover;
            margin-bottom: 7px !important;
            /* 精确控制间距 */
        }

        #techName1 {
            margin-left: 120px !important;
            margin-top: 0 !important;
            font-size: 16px;
            transform: translateY(-3px);
            /* 微调垂直位置 */
        }

        /* 微信图保持原始尺寸 */
        #techQrCodeImg {
            width: auto !important;
            height: auto !important;
            max-width: 100%;
            max-height: 200px;
            object-fit: contain;
        }

        /* 手机端修复方案（保持原有HTML不变） */
        @media (max-width: 767px) {

            /* 1. 主图区域设置 */
            #product-details>div {
                width: 90% !important;
                margin: 0 !important;
                padding: 0 !important;
            }

            /* 2. 主图下方姓名（最小间距） */
            #techName1 {
                display: block;
                width: 90% !important;
                margin: -2px auto 0 auto !important;
                /* 上移2px */
                padding: 0 !important;
                text-align: center;
                font-size: 16px;
                line-height: 1 !important;
                position: relative;
                top: -1px !important;
                /* 微调上移 */
            }

            /* 3. 微信区域姓名（无下划线+原色） */
            .col-md-3 a.txt[id*="Name"] {
                /* 精准选择微信姓名链接 */
                text-decoration: none !important;
                /* 去除下划线 */
                color: inherit !important;
                /* 继承原色 */
                border-bottom: none !important;
                display: inline-block !important;
                /* 保持原有布局 */
            }

            /* 4. 二维码保护 */
            #techQrCodeImg {
                width: auto !important;
                height: auto !important;
                max-width: 200px !important;
                object-fit: contain !important;
            }
        }


        /* 3. 二维码放大+靠左 */
        #techQrCodeImg {
            width: 220px !important;
            /* 放大尺寸 */
            height: 220px !important;
            margin: 15px 0 0 0 !important;
            /* 靠左显示 */
            display: block;
            border: 1px solid #eee;
            background: white;
        }

        /* 4. 布局修正 */
        .product-detail .panel-body {
            overflow: visible !important;
        }

        .col-md-3 {
            padding-left: 0 !important;

        }

        /* ========== 超大二维码版本 (可选) ========== */
        @media (max-width: 767px) {
            .max-qrcode #techQrCodeImg {
                width: 240px !important;
                height: 240px !important;
            }
        }
    </style>

    <script>
        // 配置常量
        const API_CONFIG = {
            baseUrl: 'http://47.108.230.236:9070',
            staticBase: '/profile',
        };

        document.addEventListener('DOMContentLoaded', function () {
            const urlParams = new URLSearchParams(window.location.search);
            const techId = urlParams.get('id');

            if (!techId) {
                console.error('URL中缺少技师ID参数');
                return;
            }

            // 1. 禁用默认的懒加载行为
            const qrImg = document.getElementById('techQrCodeImg');
            qrImg.loading = 'eager'; // 强制立即加载
            qrImg.removeAttribute('data-original'); // 移除懒加载属性

            // 2. 直接加载微信图（不经过预加载）
            fetch(`${API_CONFIG.baseUrl}/html/${techId}`)
                .then(response => {
                    if (!response.ok) throw new Error(`HTTP ${response.status}`);
                    return response.json();
                })
                .then(data => {
                    const tech = data.data || data;
                    if (tech.listImg) {
                        // 3. 使用绝对路径避免相对路径问题
                        const absolutePath = `${API_CONFIG.baseUrl}${API_CONFIG.staticBase}${tech.listImg}`;

                        // 4. 添加时间戳防止缓存
                        qrImg.src = `${absolutePath}?t=${Date.now()}`;

                        // 5. 简化错误处理（移除了默认图片回退逻辑）
                        qrImg.onerror = () => {
                            console.error('图片加载失败:', absolutePath);
                        };
                    }

                    // 主图和姓名处理
                    if (tech.mainImg) {
                        document.getElementById('techMainImg').src =
                            `${API_CONFIG.baseUrl}${API_CONFIG.staticBase}${tech.mainImg}`;
                    }
                    if (tech.name) {
                        document.querySelectorAll('[id^="techName"]').forEach(el => {
                            el.textContent = tech.name;
                        });
                    }
                })
                .catch(error => {
                    console.error('加载失败:', error);
                });
        });
    </script>

</body>

</html>